﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using CM.BL.BC;

namespace WebApp
{
    public partial class release : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            string strpo, strco, retval; bool oLib = false;
            if (!Page.IsPostBack)
            {
                strpo = Request.QueryString["po"];
                strco = Request.QueryString["co"];
                if (!string.IsNullOrEmpty(strpo) && !string.IsNullOrEmpty(strco))
                {
                    retval = PurchaseOrderBC.getInstance(Session.SessionID).releasePO(strpo, strco, out oLib);
                    if (oLib) { Response.Redirect("List.aspx?m=" + retval); }
                    else { Response.Redirect("detail.aspx?po=" + strpo + "&m=" + retval); }
                }
            }
        }
    }
}
